import { createWebHistory, createRouter } from 'vue-router'
import Home from '../views/Home.vue'
import Dashboard from '../views/Dashboard.vue'
import Farmlist from '../views/Farmlist.vue'
import User from '../views/User.vue'
import Login from '../views/Login.vue'
import Default from '../views/Default.vue'
import Message from '../views/Message.vue'

const routes = [
    {
        path: '/home',
        component: Home,
        //子路由（嵌套路由）的配置，需要使用children属性进行配置
        children: [
            {
                path: '',
                component: Default
            },
            {
                path: '/dashboard',
                component: Dashboard
            },{
                path:'/farmlist',
                component:Farmlist
            },{
                path:'/user',
                component:User
            },{
                path:'/message',
                component:Message
            }
        ]
    },{
        path:'/',
        component:Login
    }

]
const router = createRouter({
    history: createWebHistory(),
    routes,
});
export default router;